package main

import (
	"fmt"
	"io"
	"log"
	"net/http"
	"os/exec"
)

func relauch(){
 	cmd := exec.Command("sh","./deploy.sh")
 	err := cmd.Start()
 	fmt.Println(err)
 	if err != nil{
 		log.Fatal(err)

	}
 	cmd.Wait()
}

func firstPage(w http.ResponseWriter,r *http.Request){
	io.WriteString(w,"<h1>hello,this is my deploy server!</h1>")
	relauch()
	fmt.Println("aaaaaaaaaaaaaaaaaaaaaa")
}

func main() {
	http.HandleFunc("/",firstPage)

	http.ListenAndServe(":5000",nil)
}
